﻿using LicMagnaCmsData;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MnCmsAutoUpdate
{
    public partial class CmsAutoGet : Form
    {
        public CmsAutoGet()
        {
            InitializeComponent();
            try
            {
                App.DBconSet(); //数据库连接设定
                List<string> DataList = new List<string>();
                string strSql = "SELECT * FROM CMS_TABLELIST";
                DataTable dt = App.GetDataTable(App.DBconWMS, strSql, "TABLELIST");
                if (dt.Rows.Count > 0)
                {
                    DataList.Clear();
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        DataList.Add(dt.Rows[i]["tablename"].ToString());
                    }
                    LicMagnaCmsData.MainHandler.MessageHandlerGet(DataList, "GET");
                }

            }
            catch (Exception ex)
            {
                LicMagnaCmsData.App.Log("GetCmsData-1.0", ex.Message.ToString());
            }
        }

        private void btn_CmsDataGet_Click(object sender, EventArgs e)
        {
            //try
            //{
            //    List<string> DataList = new List<string>();
            //    DataList.Add("CMS_STKMM");
            //    DataList.Add("CMS_STKMP");
            //    DataList.Add("CMS_POH");
            //    DataList.Add("CMS_POI");
            //    LicMagnaCmsData.MainHandler.MessageHandlerGet(DataList, "GET");
            //}
            //catch (Exception ex)
            //{

            //}
        }
    }
}
